using PandaWebAPI.Models.ef;

namespace PandaWebAPI.Services;

/// <summary>
/// 验证码服务接口
/// </summary>
public interface IVerificationCodeService
{
    /// <summary>
    /// 获取所有验证码
    /// </summary>
    Task<IEnumerable<VerificationCode>> GetAllAsync();

    /// <summary>
    /// 根据ID获取验证码
    /// </summary>
    Task<VerificationCode?> GetByIdAsync(Guid id);

    /// <summary>
    /// 根据用户ID获取验证码
    /// </summary>
    Task<VerificationCode?> GetByUserIdAsync(Guid userId);

    /// <summary>
    /// 创建验证码
    /// </summary>
    Task<VerificationCode> CreateAsync(VerificationCode verificationCode);

    /// <summary>
    /// 更新验证码
    /// </summary>
    Task<VerificationCode> UpdateAsync(VerificationCode verificationCode);

    /// <summary>
    /// 删除验证码
    /// </summary>
    Task DeleteAsync(Guid id);

    /// <summary>
    /// 验证验证码
    /// </summary>
    Task<bool> VerifyCodeAsync(string code, byte codeType, Guid? userId = null);

    /// <summary>
    /// 标记验证码为已使用
    /// </summary>
    Task MarkAsUsedAsync(Guid codeId);
} 